package com.ktjy.ktmall.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ktjy.common.annotation.Excel;
import com.ktjy.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;

/**
 * Sku对象 t_sku_info
 *
 * @author ktjy
 * @date 2025-01-13
 */
@Data
@TableName("t_sku_info")
public class SkuInfo extends BaseEntity {
    private static final long serialVersionUID=1L;

    /** 主键id */
    @TableId(value = "id" , type = IdType.AUTO)
    private Long id;

    /** 商品表id,引用t_goods_info中商品表中的id */
    @Excel(name = "商品表id,引用t_goods_info中商品表中的id")
    @TableField(value = "goods_id")
    private Long goodsId;

    /** sku编码(唯一编码) */
    @Excel(name = "sku编码(唯一编码)")
    @TableField(value = "stock_sku")
    private String stockSku;

    /** 当前价格 */
    @Excel(name = "当前价格")
    @TableField(value = "price")
    private BigDecimal price;

    /** 原价 */
    @Excel(name = "原价")
    @TableField(value = "old_price")
    private BigDecimal oldPrice;

    /** 库存数量 */
    @Excel(name = "库存数量")
    @TableField(value = "inventory")
    private Long inventory;

    /** 商品图片 */
    @Excel(name = "商品图片")
    @TableField(value = "picture")
    private String picture;

    /** 状态(0:正常 1:禁用) */
    @Excel(name = "状态(0:正常 1:禁用)")
    @TableField(value = "status")
    private Long status;


    @Override
    public String toString(){
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
                .append("id" ,getId())
                .append("goodsId" ,getGoodsId())
                .append("stockSku" ,getStockSku())
                .append("price" ,getPrice())
                .append("oldPrice" ,getOldPrice())
                .append("inventory" ,getInventory())
                .append("picture" ,getPicture())
                .append("status" ,getStatus())
                .append("createTime" ,getCreateTime())
                .append("updateTime" ,getUpdateTime())
                .append("createBy" ,getCreateBy())
                .append("updateBy" ,getUpdateBy())
                .append("remark" ,getRemark())
                .toString();
    }
}